// TOWN DIALOGUE SCRIPT
//    Town 3: Asmur

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

begintalkscript;

variables;

int i,j,k,r1,choice;
short lead_char;



begintalknode 1;
	state = -1;
	personality = 10;
	nextstate = 1;
	condition = 1;
	question = "Valzier";
	text1 = "A tall and confident Nephil Shaman approaches you. _Greetings, I am Valzier, advisor of Lanthar, chieftain of this tribe. What business brings you to our humble village?_";
	text2 = "Valzier quietly waits for an answer. He seems much less unnerved by your presence than the others in this village.";

begintalknode 2;
	state = 1;
	personality = 10;
	nextstate = -1;
	condition = (get_sdf(110,0) == 0);
	question = "We were exploring and we stumbled across your village.";
	text1 = "The shaman responds coldly. _You are not welcome here, outsiders. All we wish is to be left alone. Please honor our wishes, or we shall need to deal with you. That is all._";
 text2 = "Valzier turns around and leaves.";
 code = 
  end();
 break;

begintalknode 3;
	state = 1;
	personality = 10;
	nextstate = 2;
	condition = (get_sdf(110,0) > 0);
	question = "We bring grave news about your village. It is vital we see your chieftain.";
	text1 = "The shaman looks very suspicious. He weighs his options, realizing this could be some kind of elaborate ruse.";
 text2 = "_No, we do not trust you. I would not endanger the life of our chieftain on a mere whim. We are not trusting of outsiders and will not make an exception to strange beings like you without proof._";
 text3 = "Klinger speaks loudly. _Proof! No amount of proof would be sufficient for you. I bring word from the resistance. Arivan plots against you this very moment. The risk of not letting us see your leader is far greater than giving our message._";
 text4 = "Valzier thinks. _The resistance, eh? Perhaps it is wise to let you see our chieftain then. Although we're leary of you, we know better than to doubt you much. Come, see our chieftain._";
 text5 = "Valzier turns and motions for you to follow. Klinger turns to you and whispers, _That was a lot easier than I thought it was going to be. Let's follow._";
 text6 = "Valzier begins to turn to leave.";
 code =
  clear_strings();
  add_string(1);
  add_string(2);
  if (get_sdf(110,0) == 1) {
   add_string(3);
   add_string(4);
   add_string(5);
   end();
  }
  else
   add_string(6);
  }
 break;

begintalknode 4;
	state = 2;
	personality = 10;
	nextstate = -1;
	condition = (get_sdf(110,0) > 0);
	question = "Wait! Your village is in danger. Arivan plans to attack, I plead with you to listen.";
	text1 = "Valzier turns. _That is very interesting. I will deliver your message to Lanthar and he will consider it. You should leave now for we do not take kindly to outsiders. Goodbye._";
 text2 = "Valzier continues to leave. You shout out but he ignores you. You guess this is the best you can do for these people.";
 code = 
  end();
 break;

begintalknode 5;
	state = -1;
	personality = 10;
	nextstate = 3;
	condition = 1;
	question = "Valzier";
	text1 = "Valzier stands behind the the chief watching you very carefully. He nods and asks, _Yes, outsiders?_";

begintalknode 6;
	state = 3;
	personality = 10;
	nextstate = 4;
	condition = 1;
	question = "How go the preparations for the attack?";
	text1 = "_They are continuing as we speak. Orders have been issued and forces are being deployed in preparation for the attack. We expect full readiness very soon. We thank you for the warning._";
 text2 = "He clears his throat and smiles. _Meanwhile, you should return to the Resistance Base and inform your leader of our response. You wouldn't want to get caught in the crossfire of our battle._";

begintalknode 7;
	state = 4;
	personality = 10;
	nextstate = -1;
	condition = 1;
	question = "Do you think the defenses will be successful?";
	text1 = "_Yes, of course,_ he replies in a surprised manner. _I helped devise them myself. They will hold up, no question about it. None._";
 text2 = "You sense a slight discomfort in his voice at your questioning.";

begintalknode 8;
	state = 4;
	personality = 10;
	nextstate = -1;
	condition = 1;
	question = "You really should reconsider our assistance. We would like to help.";
	text1 = "_No._ he responds blankly. _Master Lanthar has spoken. Our defenses are in place and they will protect us. We have trained and prepared well for the day our society would be assaulted._";
 text2 = "_I am fully confident in them. All you need to do is get out of the way._ he concludes arrogantly.";
 text3 = "Sometimes you seriously wonder about these isolated people, paranoid and xenophobic as they are. Definitely a different culture.";

begintalknode 9;
	state = 3;
	personality = 10;
	nextstate = -1;
	condition = 1;
	question = "Can you offer any assistance in our journey back?";
	text1 = "_Not I, of course._ He looks around and points to the south. _Our merchants will sell their goods to you in gratitude for your warning._";

begintalknode 10;
	state = -1;
	personality = 11;
	nextstate = 5;
	condition = 1;
	question = "Lanthar";
 text1 = "The chieftain sits quietly here. He motions for you to sit down.";
	text2 = "Lanthar looks very busy, probably preparing for the imminent attack. You doubt the leader will have much time to speak with you.";
 text3 = "Lanthar looks very ghostly. He knows that time is running out for him and his village. His defenses have failed, and his people are being slaughtered. It appears he waits for the inevitable.";
 text4 = "He turns to you and says hoarsely. _Get going! There is an escape to the east in one of the offices. Valzier will show the way. Go, before it is too late!_";
 code =
  clear_strings();
  if (get_sdf(1,4) <= 1) {
   add_string(1);
   end();
  }
  if (get_sdf(1,4) == 2)
   add_string(2);
  if (get_sdf(1,4) > 2) {
   add_string(3);
   add_string(4);
   end();
  }
 break;

begintalknode 11;
	state = 5;
	personality = 11;
	nextstate = 6;
	condition = 1;
	question = "How fairs Asmur?";
	text1 = "Lanthar looks somewhat worried. Despite this, his speech remains confident. _The preparations for the attack continue as planned. Soon everything will be in place. Our culture will be preserved._";

begintalknode 12;
	state = 6;
	personality = 11;
	nextstate = 7;
	condition = 1;
	question = "Can you tell us about your culture?";
	text1 = "He shakes his head. _I have no time. If all is as you say, we will be under attack and we must prepare. Soon I will go and inspect the guards to ensure all is in place._";
 text2 = "_Besides, outsiders would never understand._";

begintalknode 13;
	state = 7;
	personality = 11;
	nextstate = -1;
	condition = 1;
	question = "You underestimate our abilities, chieftain. You should not be so suspicous of outsiders.";
	text1 = "_I do not need your lectures, outsiders. Go now._ He says coldly as he waves you away and continues his planning. Your words will not change these people. They have felt this way for too long.";
 code =
  end();
 break;

begintalknode 14;
	state = 6;
	personality = 11;
	nextstate = 7;
	condition = 1;
	question = "You know, you should reconsider our offer of helping you.";
	text1 = "_You do not understand us. Only from within can our culture be preserved. Any interference will weaken it. Our preparations are solid. You will only hinder us. We will be fine, I assure you._";

begintalknode 15;
	state = 5;
	personality = 11;
	nextstate = -1;
	condition = 1;
	question = "The journey back is long and treacherous. Could you help us?";
	text1 = "He puts down his pen and looks up at you. _Our merchants will help you. You have our thanks for the warning. Allowing you to use our services is payment enough. They will help you as best they can._";

begintalknode 16;
	state = -1;
	personality = 12;
	nextstate = 8;
	condition = 1;
	question = "Orasar";
 text1 = "The shaman watches you very closely with extreme suspicion. It is as if the presence of outsiders deeply offends him. You seriously doubt you will get much assistance from him.";

begintalknode 17;
	state = 8;
	personality = 12;
	nextstate = -1;
	condition = 1;
	question = "What can you tell us about Asmur?";
 text1 = "He pauses before answering as if he is not supposed to. _Our customs forbid me from dealing with those not of this tribe. I can tell you nothing other than to go see Chief Lanthar to the north._";
 text2 = "He responds unwillingly, _All you see is what there is to know. We prefer to be left alone and not mess with the affairs of the outside world. We are happy here. Out there is only sadness._";
 text3 = "_That is all I can tell you about us, outsider._";
 code =
  clear_strings();
  if (get_sdf(1,4) <= 1) {
   add_string(1);
   end();
  }
  add_string(2);
  add_string(3);
 break;

begintalknode 18;
	state = 8;
	personality = 12;
	nextstate = 9;
	condition = 1;
	question = "Can you provide assistance to us?";
 text1 = "_I cannot, custom forbids it. Unless Chief Lanthar says otherwise, I am not allowed to deal with you._ The shaman points to the north, directing you.";
 text2 = "He sighs. _I have been told to provide what assistance I can. I am learned in the healing arts and can provide full healing for 100 gold per person._";
 code =
  clear_strings();
  if (get_sdf(1,4) <= 1) {
   add_string(1);
   end();
  }
  add_string(2);
 break;

begintalknode 19;
 state = 9;
 personality = 12;
 nextstate = -1;
 condition = 1;
 question = "I need healing. (Pay 100 gold)";
 text1 = "_I have been ordered to help you, but within reason. You must pay my minimal fee at least, outsiders._";
 text3 = "_Come back if someone needs healing._";
 text5 = "You pay the shaman. His knowledge of the healing arts is quite strong. He chants loudly and soothing white light engulfs you. After a few seconds, you feel reborn.";
code =
  clear_strings();
  if (coins_amount() < 100)
   add_string(1);
   else if (run_select_a_pc(1) == 0)
    add_string(3);
    else {
     play_sound(24);
     add_string(5);
     restore_pc(get_selected_pc());
     change_coins(-100);
     }
break;

begintalknode 20;
 state = 9;
 personality = 12;
 nextstate = 8;
 condition = 1;
 question = "I don't require healing. Perhaps you could help with something else. Spells perhaps?";
 text1 = "He shakes his head. _Teaching an outsider is not in the realm of help I was told to give. That would be an egregous crime to commit. No, only healing. That is all I can offer you._";

begintalknode 21;
	state = -1;
	personality = 22;
	nextstate = 10;
	condition = 1;
	question = "Krrroa";
	text1 = "A lanky Nephilim in his middle aged years with graying fur around his ears and nose maintains the library. He does not seem afraid of you at all. In fact, he seems rather curious and unusually willing to speak with you.";
 text2 = "He even approaches you and nods. _I am named Krrroa. Welcome to Asmur._";

begintalknode 22;
	state = 10;
	personality = 22;
	nextstate = 11;
	condition = 1;
	question = "Why is everyone else so suspicious of me?";
	text1 = "He frowns. _Long ago we were a prosperous tribe. However, a few decades ago there was a movement to destroy all weakness and imperfection. It got very violent, but was quashed. Our tribe was devastated._";
 text2 = "_The blame was placed on ideas from outsiders. From a scholarly standpoint, this was not true, but tribes have a habit of projecting their negatives. So, our elders declared that all contact with the outside world cut off._";
 text3 = "_We were all afraid then and in the years that followed we became paranoid. I know now that this is not merited, but just about everyone else refuses to give up those prejudices despite evidence to the contrary._";

begintalknode 23;
	state = 11;
	personality = 22;
	nextstate = -1;
	condition = (get_sdf(0,7) > 0);
	question = "Are you aware that Vikida is pursuing the same movement?";
	text1 = "He shakes his head. _The fools. Can they not see that such things are a waste of good life..._ He begins to ponder lamentingly.";
 text2 = "_You would think they would've remembered us. If we do not learn from our mistakes, we are doomed to repeat them. I suppose they will learn in time._";
 text3 = "_Nonetheless, thank you for the information. I get to hear so very little of the outside world in this climate. It will definitely aid in my understanding of our history to know this._";

begintalknode 24;
	state = 11;
	personality = 22;
	nextstate = 12;
	condition = 1;
	question = "How do you think these ideas came about?";
	text1 = "_I'm not sure yet. The records from those years are sketchy and many were lost. The odd thing is that they seemingly sprung up over a very short period of time among many people._";
 text2 = "_We did, however, have many expeditions going on at the time. A few of these expeditions are surprisingly secret. I suspect they are coded in the tribal scrolls, but I am unable to see them._";

begintalknode 25;
	state = 12;
	personality = 22;
	nextstate = -1;
	condition = 1;
	question = "Tell me about the tribal scrolls.";
	text1 = "_Only the chieftain can see them, and are very well hidden and protected. Rumors say that the scrolls contain the ancient secrets of the power behind the revolutions. That's why no one but Lanthar may read them._";
 text2 = "_I have tried to convince Lanthar to let me view them, but custom forbids this._";

begintalknode 26;
	state = 12;
	personality = 22;
	nextstate = -1;
	condition = 1;
	question = "So then where did the ideas come from?";
	text1 = "_I don't know. Our period of great advancement began quite suddenly. Knowledge and ideas from nowhere! This leads me to believe the cause of the dark ideas, as well as our great technological achievements may not be our own._";
 text2 = "_I call it my 'Beyond Natural Theory'. While it is popular to believe our destructive doctrine of production came from outsiders, it is unpopular to believe our golden age of advancement came from the same source._";
 text3 = "_I supose I've learned that people will only believe what they want to believe, regardless of the truth._";

begintalknode 27;
	state = 11;
	personality = 22;
	nextstate = -1;
	condition = 1;
	question = "Is it frustrating to have your research ignored?";
	text1 = "He scowls softly. _Yes, it is. People have a habit of believing what they want to believe, regardless of what evidence says otherwise. I'd be willing to bet your civilization has similar attitudes._";

begintalknode 28;
	state = 10;
	personality = 22;
	nextstate = 13;
	condition = 1;
	question = "Are you the librarian?";
	text1 = "_Yes I am. I do many scholarly things here as well. Most of my time, however, is spent maintaining this library. The forest is damp, full of bugs, and with lots of other things unfriendly to paper._";
 text2 = "_It is a constant stuggle to maintain this place. I often find myself recopying old documents when the paper becomes worn. It's very expensive and my funding is quite inadequate._";
 text3 = "_I've been forced to resort to selling scrolls that I make. The hunters use them for defense and I get some money to help maintain this place.";

begintalknode 29;
	state = 13;
	personality = 22;
	nextstate = -1;
	condition = 1;
	question = "May we buy some scrolls?";
	text1 = "You finish shopping.";
 text2 = "He sighs loudly. _Unfortunately, custom forbids me dealing with outsiders. Only with permission from the chieftain himself may I deal with you. It saddens me, but I cannot._";
 code =
  clear_strings();
  if (get_sdf(1,4) < 2)
   add_string(2);
  else {
   add_string(1);
   begin_shop_mode("Asmur Library", "Krrroa, because of inadequate funding, sells scrolls to help maintain the tribal library. Now that you have permission from the chief, he may sell you his goods.", 13, 2, -1);
   }
 break;